package com.hj.saapp.model.Validation;

import android.content.Context;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Administrator on 2015/10/13.
 */
public class PasswordValidator extends ValidationExecutor {
    @Override
    public boolean doValidate(Context context, String text) {
        if (!("").equals(text))
        {
            String regExp = "^[0-9a-zA-Z]{6,16}$";
            Pattern p = Pattern.compile(regExp);
            Matcher m = p.matcher(text);
            boolean result = m.find();
            if (!result) {
                return false;
            }
            return true;
        }
        else
        {
            return false;
        }
    }
}
